//收藏 与 首页
function AddFavorite(sURL, sTitle){
	try{
		window.external.addFavorite(sURL, sTitle);
	}
	catch (e){
		try{
			window.sidebar.addPanel(sTitle, sURL, "");
		}
		catch (e){
			alert("对不起，您的浏览器不支持此操作!请您使用菜单栏或Ctrl+D收藏本站。");
			}
		}
	}
function SetHome(obj,vrl){
	try{
		obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
	}catch(e){
	if(window.netscape) {
		try {
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
		}
	catch (e) {
	alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
	}
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage',vrl);
		}
	}
}
$(function(){
	$.ajax({
		url:'/about/sysset',
		data:'ajax=1',
		dataType:'json',
		success: function(d){
			// console.debug(d);
			if(d){
				if(d.clientqq){
					var arrqq = d.clientqq.split(',');
					var qqhtml = '';
					$.each(arrqq, function(k,v){
						qqhtml += '<a href="http://wpa.qq.com/msgrd?v=1&uin='+v+'&site=qq&menu=yes" target="_blank"><img border="0" title="点击这里给我发消息" alt="点击这里给我发消息" src="/img/qq.jpg"></a>';

					});
					$('.onlineQQ div.cont').html(qqhtml);
				}

				if(d.indexpageimages && $('#slider').length>0){
					var _images = d.indexpageimages.split(',');
					var sliderhtml = '';
					$.each(_images, function(k,v){
						sliderhtml += '<a href="javascript:void(0)" style="cursor:default;"><img src="';
						sliderhtml += '/data/indexpageimages/'+v;
						sliderhtml += '" alt="1"/></a>';
					})
					$('#slider').html(sliderhtml);
					$('#slider').nivoSlider();
					//图滚动
					$("#scroller_roll1").scroller_roll({
						title_show: 'enable',//enable  disable
						time_interval: '30',
						window_background_color: "none",
						window_padding: '1',
						border_size: '0',
						border_color: '#0099CC',
						images_width: '110',
						images_height: '65',
						images_margin: '5',
						title_size: '12',
						title_color: 'black',
						show_count: '4'
					});
				}
				if(d.bottomlinks){
					$('.footer .bottomlinks').html(d.bottomlinks);
				}
			}
		}
	})
	var qq_html = '<div class="onlineQQ"style="width:120px;height:236px;background:url(/img/1.gif) no-repeat;position:absolute"><div class="cont P8"><a target="_blank"href="http://wpa.qq.com/msgrd?v=1&amp;uin=286813758&amp;site=qq&amp;menu=yes"><img border="0"src="/img/qq.jpg"alt="点击这里给我发消息"title="点击这里给我发消息"></a><a target="_blank"href="http://wpa.qq.com/msgrd?v=1&amp;uin=286813758&amp;site=qq&amp;menu=yes"><img border="0"src="/img/qq.jpg"alt="点击这里给我发消息"title="点击这里给我发消息"></a></div></div>';
	$(qq_html).appendTo("body");
	$(".onlineQQ").hide();
	$(".onlineQQ").css({"top":171+$(window).scrollTop(),"left":$(window).width()/2-500-160});
	$(window).scroll(function(){var offsetTop=86+$(window).scrollTop()+"px";
	$(".onlineQQ").animate({top:offsetTop,"left":$(window).width()/2-500-160},{duration:500,queue:false})});
	$(window).resize(function(){var offsetTop=86+$(window).scrollTop()+"px";
	$(".onlineQQ").animate({top:offsetTop,"left":$(window).width()/2-500-160},{duration:500,queue:false})});
	$(".clickclose").click(function(){$(".onlineQQ").hide();});
	window.setTimeout(showwin,500);
})
function showwin(){$(".onlineQQ").fadeIn('slow');}